<?php
class Sales_kardex_model extends CI_Model {
    
    
    private $_tabla = 'sales_kardex';
           
    public function addKardexSales($data)
    {
        $this->db->insert($this->_tabla, $data);
    }
        
    public function findBySaleId($sale_id){
        $this->db->select();
        $this->db->where('sale_id', $sale_id);
        $query = $this->db->get($this->_tabla);
        $rs = $query->result();
		return $rs;
    }
	
	public function deleteAll($sale_id){
		$this->db->query("DELETE FROM sales_kardex WHERE sale_id='".$sale_id."'");
	}
}